import request from '@/utils/request'

// 查询APP端banner图列表
export function listBanner(query) {
  return request({
    url: '/app/banner/list',
    method: 'get',
    params: query
  })
}

// 查询APP端banner图详细
export function getBanner(bannerId) {
  return request({
    url: '/app/banner/' + bannerId,
    method: 'get'
  })
}

// 新增APP端banner图
export function addBanner(data) {
  return request({
    url: '/app/banner',
    method: 'post',
    data: data
  })
}

// 修改APP端banner图
export function updateBanner(data) {
  return request({
    url: '/app/banner',
    method: 'put',
    data: data
  })
}

// 删除APP端banner图
export function delBanner(bannerId) {
  return request({
    url: '/app/banner/' + bannerId,
    method: 'delete'
  })
}

// 导出APP端banner图
export function exportBanner(query) {
  return request({
    url: '/app/banner/export',
    method: 'get',
    params: query
  })
}

// 改变状态
export function changeBannerStatus(bannerId, bannerStatus) {
  const data = {
    bannerId,
    bannerStatus
  }
  return request({
    url: '/app/banner/changeBannerStatus',
    method: 'put',
    data: data
  })
}
